package src.itheima08;

import java.sql.Connection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

public class PokerTest {
    public static void main(String[] args) {

        ArrayList<String> pokers = new ArrayList<>();
        ArrayList<String> colors = new ArrayList<>();
        ArrayList<String> nums = new ArrayList<>();

        colors.add("♥");
        colors.add("♠");
        colors.add("♣");
        colors.add("♦");

       for(int i=2;i<=10;i++){
           nums.add(i+"");
       }
        nums.add("J");
        nums.add("Q");
        nums.add("K");
        nums.add("A");
        for (String num : nums) {
            for (String color : colors) {
                String pike=num+color;
                pokers.add(pike);
            }
        }
        pokers.add("小王");
        pokers.add("大王");
        Collections.shuffle(pokers);

        //发牌

        ArrayList<String> p1 = new ArrayList<>();
        ArrayList<String> p2 = new ArrayList<>();
        ArrayList<String> p3 = new ArrayList<>();
        ArrayList<String> bottom = new ArrayList<>();

        for(int i=0;i<pokers.size();i++){
           String poker=pokers.get(i);
            if (i>50){
            bottom.add(poker);
            }else{
                if(i%3==0){
                   p1.add(poker);
                }else if (i%3==1){
                   p2.add(poker);
                }else {
                   p3.add(poker);
                }
            }
        }
        System.out.println("1:"+p1);
        System.out.println("2:"+p2);
        System.out.println("3:"+p3);
        System.out.println("4:"+bottom);
    }
}
